package cate.common.table.d;

import cate.common.table.common.ParamSheet;
import easy.java.dev.note.NoteClass;
import easy.java.dev.note.NoteField;

@NoteClass(value = "剧本")
public class GDPlay {

    /** 剧本中输出战斗详情 */
    public static boolean ENABLE_PLAY_DETAIL = false;

    /** 行动类型 */
    public static final class ActionType {
        /** 归位(回到原来的位置) */
        public static final byte BACK = 0;
        /** 主动技能行为 */
        public static final byte SKILL_ACTIVE = 1;
        /** 被动技能行为 */
        public static final byte SKILL_POSITIVE = 2;
        /** buff行为 */
        public static final byte BUFF = 3;
        /** 时间行为(比如因为回合结束而buff过期) */
        public static final byte TIME = 4;
        /** 混乱状态下使用普攻行为 */
        public static final byte SKILL_CHAOS = 5;
    }


    /** 结果类型 */
    public static final class ResultType {
        /** 目标瞄准 */
        public static final byte AIM = 0;
        /** 当前血量改变 */
        public static final byte HP_CHANGE = 1;
        /** 血量最大值改变 */
        public static final byte HP_MAX_CHANGE = 2;
        /** 攻击发生miss */
        public static final byte MISS = 3;
        /** 护盾值改变 */
        public static final byte SHIELD_CHANGE = 4;
        /** 能量槽改变 */
        public static final byte ENERGY_CHANGE = 5;
        /** 地面瞄准 */
        public static final byte AIM_POS = 6;



        /** 复活 */
        public static final byte RESURRECT = 11;
        /** 死亡 */
        public static final byte DEAD = 12;
        /** 斩杀 */
        public static final byte KILL = 13;

        /** 变身 */
        public static final byte MORPH = 14;
        /** 变身结束 */
        public static final byte MORPH_END = 15;



        /** buff添加成功 */
        public static final byte BUFF_ADD = 21;
        /** buff更新 */
        public static final byte BUFF_UPDATE = 23;
        /** buff移除 */
        public static final byte BUFF_REMOVE = 24;
        /** buff播报 */
        public static final byte BUFF_ANNOUNCE = 25;
        /** 被动技能播报 */
        public static final byte SKILL_ANNOUNCE = 26;

        /** 位移 */
        public static final byte MOVE = 31;

        /** 召唤 */
        public static final byte SUMMON = 41;

    }


    @NoteClass("血量变更原因")
    public static final class HpReason{
        /** 技能直接伤害 */
        public static final int SKILL_HURT = 1;
        /** 主动技能治疗 */
        public static final int SKILL_HEAL = 2;
        /** BUFF造成的 */
        public static final int BUFF = 3;
        /** 属性吸血 */
        public static final int ATTR_SUCK = 4;
        /** 元素伤害 */
        public static final int ELEMENT = 5;
        /** 分摊伤害 */
        public static final int SHARE_HURT = 9;
        /** 被动技能伤害*/
        public static final int PASSIVE_SKILL_HURT = 14;
        /** 被动技能治疗*/
        public static final int PASSIVE_SKILL_HEAL = 15;
    }

    @NoteClass("护盾值变更原因")
    public static final class ShieldReason{
        /** 吸收伤害 */
        public static final int ABSORB = 0;
        /** buff添加或移除 */
        public static final int BUFF_CHANGE = 1;
    }


    /** 播放时间 */
    public static final class PlayTime {
        /** 归位时间 */
        public static final int BACK = 200;
        /** 死亡时间 */
        public static final int DEAD = 1000;
        /** 入场时间 */
        public static final int ENTER = 5000;
    }


    public static class Rate{
        @NoteField("2倍速开启主线关卡要求")
        public static int RATE_2_LIMIT;

        @NoteField("3倍速开启主线关卡要求")
        public static int RATE_3_LIMIT;

        public static boolean isOpen(int rate, int combatNum){
            if(rate == 2){
                return combatNum >= RATE_2_LIMIT;
            }else if(rate == 3){
                return combatNum >= RATE_3_LIMIT;
            }
            return true;
        }
    }

    public static void initialize(ParamSheet paramSheet){
        Rate.RATE_2_LIMIT = GDParamTool.getInt(paramSheet, 1702, 3);
        Rate.RATE_3_LIMIT = GDParamTool.getInt(paramSheet, 1701, 480);
    }
}
